<!--{*Part of the CEFIRO project by dyrtech.com.ve. Copyleft GPLv3 2007. Please see the disclaimer at the root of the project: http://dyrtech.com.ve/cefiro/license.txt*}-->
{if $inline_scripts == "true"}
		{$name}grid = new dhtmlXGridObject('{$name}gridbox');
		{$name}grid.setDelimiter("|");
		{$name}grid.setHeader("|{$first_input_field}|{$second_input_field}|{$third_input_field}");
		{$name}grid.setInitWidths("20|{foreach name=sizes from=$fields_size item=size}{if $smarty.foreach.sizes.iteration != 1}|{/if}{$size}{/foreach}");
		{$name}grid.setColAlign("left|left|left|left");
		{$name}grid.setColTypes("img|ro|ro|ro");
		{$name}grid.setColSorting("str|str|str|str");
		{$name}grid.setImagePath("{$gridimg}");
		{$name}grid.enableMultiselect(false);
		{$name}grid.init();
		{$name}displays = new Array(
			{foreach name=create_disp_array from=$display_fields item=field}
				{if $smarty.foreach.create_disp_array.iteration != 1},{/if}"{$field}"
			{/foreach}
		);

		{$name}searchArgs = new Array(
			'{$name}nombreInp'
			{foreach name=create_args_array from=$extra_args item=arg}
				,"{$arg}"
			{/foreach}
		);
{else}



<td class="lbl">{$label}
	<link rel="stylesheet" type="text/css" href="{$searchinggridcss}">
	<link rel="stylesheet" type="text/css" href="{$gridcss}">

	{if $show_scripts == "true" && $searching_grid_instance < 2}
		<script src="{$searchinggridjs}"></script>
		<script src="{$commonjs}"></script>
		<script src="{$gridjs}"></script>
		<script src="{$gridcelljs}"></script>
		<script src="{$movejs}"></script>
	{/if}

	{if $domain|truncate:3:"" == "A1:" || $domain eq "A1"}
		<span class="lbl-req"> *</span>
	{/if}
</td>
<td>
		<input class='input-lbl-busqueda-zajax' onclick="mostrarTablaBuscar(event,'{$name}','{$name}idInp',{$parent}{$name}grid,'{$name}nombreInp','{$name}nomAct','{$name}idAct','{$name}tblBuscar');" onfocus="mostrarTablaBuscar(event,'{$name}','{$name}idInp',{$parent}{$name}grid,'{$name}nombreInp','{$name}nomAct','{$name}idAct','{$name}tblBuscar');" name="{$name}" id="{$name}" type="text" value="{$value}" readonly='true' size="20" {$__opt}>
		<img class="img-cal" src="{$searchinggridimg}buscar.png" title='Buscar {$label}' align="top" onclick="mostrarTablaBuscar(event,'{$name}','{$name}idInp',{$parent}{$name}grid,'{$name}nombreInp','{$name}nomAct','{$name}idAct','{$name}tblBuscar');">
		<input name="d_{$name}" id="d_{$name}" type="hidden" value="{$domain}" readonly="true">
		<div id="{$name}tblBuscar" class="invisible">
			<table cellpadding="4" cellspacing="0" border="0">
				<tbody>
					<tr>
						<td class="td-tit-grid-bus" colspan="2" align="center">
							<table width="100%" cellpadding="0" cellspacing="0">
								<tr>
									<td class="lbl-tit-grid-bus" style="cursor: move;" onmousedown="dragStart(event, '{$name}tblBuscar')">
										Buscar {$label}
									</td>
									<td align="right">
										<div class="img-puntero" onclick="ocultarTablaBuscar('{$name}','{$name}tblBuscar');">
											<img src="{$gridimg}cerrar.gif" title="Cerrar">
										</div>
									</td>
								</tr>
							</table>
						</td>
					</tr>
					<tr>
						<td colspan="2" height="5px"></td>
					</tr>
					<tr>
						<td class="lbl">
							{$search_field}
						</td>
						<td>
							<input type="hidden" name="{$name}nomAct" id="{$name}nomAct" readonly="true">
							<input type="hidden" name="{$name}idAct" id="{$name}idAct" readonly="true">
							<input type="text" name="{$name}nombreInp" id="{$name}nombreInp" size="25" >
						</td>
					</tr>
					<tr>
						<td colspan="2" height="5px"></td>
					</tr>
					<tr>
						<td colspan="2">
							<center>
								<table cellpadding="0" cellspacing="0" border="0">
									<tr>
										<td class="td-btn-top-left"></td>
										<td class="td-btn-top-center"></td>
										<td class="td-btn-top-right"></td>
									</tr>
									<tr>
										<td class="td-btn-border-left"></td>
										<td class="td-btn-center">
											<input class="btn" id="g1" value="Buscar" type="button" onclick="buscarInp('{$name}displays', {$parent}{$name}grid, '{$query}', '{$env}', '{$parent}{$name}grid', '{$name}', '{$id_db_field}', '{$first_db_field}', '{$second_db_field}', '{$third_db_field}','{$name}idInp','{$name}nomAct','{$name}idAct','{$name}tblBuscar',{$name}searchArgs);"/>
										</td>
										<td class="td-btn-border-right"></td>
									</tr>
									<tr>
										<td class="td-btn-tail-left"></td>
										<td class="td-btn-tail-center"></td>
										<td class="td-btn-tail-right"></td>
									</tr>
								</table>
							</center>
						</td>
					</tr>
					<tr colspan="2">
						<td>
							<span class="lbl-eti">
								Pulse en la imagen <img src="{$gridimg}seleccionar.gif" title='Seleccionar {$label}' align="top"> para seleccionar
							</span>
						</td>
					</tr>
					<tr>
						<td colspan="2">
							<div id="mensaje" class="msg-grid"></div>
							<div id="gridbox1" width="400px" height="90px" style="background-color:white;overflow:hidden"></div>
						</td>
					</tr>
					<tr>
						<td colspan="2">
							<div align="center" id="mensaje" class="msg-grid"></div>
							<div align="center" id="{$name}gridbox" width="400px" height="90px" style="background-color:white;overflow:hidden"></div>
						</td>
					</tr>
					<tr>
						<td>
							<input class="chk-box" type='checkbox' id="sin_{$name}" name='sin_{$name}' value=''>
							<label class="chk-box-lbl" for="sin_{$name}" onclick="zajax.$('{$name}idInp').value=''; zajax.$('{$name}').value=''; zajax.$('sin_{$name}').checked=true; ocultarTablaBuscar('{$name}','{$name}tblBuscar');">
								Sin {$label}
							</label>
						</td>
					</tr>
				</tbody>
			</table>
		</div>
		{if $show_scripts == "true"}
		  <script src="{$searchinggridjs}"></script>
		  <script src="{$commonjs}"></script>
		  <script src="{$gridjs}"></script>
		  <script src="{$gridcelljs}"></script>
		  <script src="{$movejs}"></script>
			<script>
				{$name}grid = new dhtmlXGridObject('{$name}gridbox');
				{$name}grid.setDelimiter("|");
				{$name}grid.setHeader("|{$first_input_field}|{$second_input_field}|{$third_input_field}");

				{$name}grid.setInitWidths("20|{foreach name=sizes from=$fields_size item=size}{if $smarty.foreach.sizes.iteration != 1}|{/if}{$size}{/foreach}");
				{$name}grid.setColAlign("left|left|left|left");
				{$name}grid.setColTypes("img|ro|ro|ro");
				{$name}grid.setColSorting("str|str|str|str");
				{$name}grid.setImagePath("{$gridimg}");
				{$name}grid.enableMultiselect(false);
				{$name}grid.init();

				{$name}displays = new Array(
					{foreach name=create_disp_array from=$display_fields item=field}
						{if $smarty.foreach.create_disp_array.iteration != 1},{/if}"{$field}"
					{/foreach}
					);

				{$name}searchArgs = new Array(
					'{$name}nombreInp'
					{foreach name=create_args_array from=$extra_args item=arg}
						,"{$arg}"
					{/foreach}
					);
			</script>
		{/if}

		<input type="hidden" name="{$name}idInp" id="{$name}idInp" value="{$idvalue}" readonly="true">
</td>
<td class="msg-validar" id="m_{$name}"></td>

{/if}